package puyu.manage.service.template.service.impl;


import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import puyu.manage.service.common.dao.CommonMapper;
import puyu.manage.service.template.dao.TemplateMapper;
import puyu.manage.service.template.service.ITemplateService;
import puyu.manage.service.utils.R;
import puyu.manage.service.utils.redis.RedisUtil;

import java.util.*;

@Slf4j
@Service
@Transactional(rollbackFor = Exception.class)
public class TemplateService implements ITemplateService {
    @Autowired(required = false)
    TemplateMapper templateMapper;
    @Autowired(required = false)
    CommonMapper commonMapper;

    @Autowired(required = false)
    RedisUtil redisUtils;

    public List excuteFunc(Map params) throws Exception {
        return null;
    }

    public R updateagencyGuid(Map<String, Object> datas) throws Exception {
        return null;
    }

    public List organization() throws Exception {
        return null;
    }

    @Override
    public void ceshi() {
        List<Map<String, Object>> oldList=new ArrayList<>();
        Map<String, Object> data1=new HashMap<>();
        data1.put("adj_batch_no","批次1");
        data1.put("is_deleted",2);
        oldList.add(data1);

        Map<String, Object> data2=new HashMap<>();
        data2.put("adj_batch_no","批次1");
        data2.put("is_deleted",2);
        oldList.add(data2);

        Map<String, Object> data3=new HashMap<>();
        data3.put("adj_batch_no","批次1");
        data3.put("is_deleted",1);
        oldList.add(data3);

        Map<String, Object> data4=new HashMap<>();
        data4.put("adj_batch_no","批次2");
        data4.put("is_deleted",1);
        oldList.add(data4);

        String sList[]={"舒服","是否","任天堂","斯康杜尼富士","是否"};
        redisUtils.set("csString","123SS撒范德萨");
        redisUtils.set("csList",sList);
        redisUtils.set("csSet",sList);//去重的list
        redisUtils.set("csHash",data1);//map
        redisUtils.set("csZset",sList);//有序的去重的list
        redisUtils.set("csListMap",oldList);//list<Map>

        System.out.println(redisUtils.get("csString"));
        System.out.println(redisUtils.get("csSet"));
        System.out.println(redisUtils.get("csHash"));
        System.out.println(redisUtils.get("csHash"));
        System.out.println(redisUtils.get("csZset"));
    }
}
